import Vue from 'vue'
import VueRouter from "./kvue-router"
import Home from '../views/Home.vue'

// 1.VueRouter是一个插件？
// vue.use这个方法会调用插件install(vue) 

Vue.use(VueRouter)
const routes = [{
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',

        component: () => import('../views/About.vue')
    }
]
// 2.创建实例
const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router